package DD6;


import java.util.ArrayList;
import java.util.Collection;

public class ForTest {
	public static void main(String[] args) {
		 ForTest F1 = new ForTest();
		// F1.test1();
		 F1.test2();
		 F1.test3();
	}
    public void test1(){
        Collection coll = new ArrayList();
        coll.add(123);
        coll.add(456);
        coll.add(new String("Tom"));
        coll.add(false);

        for(Object obj : coll){
            System.out.println(obj);
        }
    }

    public void test2(){
        int[] arr = new int[]{1,2,3,4,5,6};
        for(int i : arr){
            System.out.println(i);
        }
    }

    public void test3(){

        String[] arr = new String[]{"MM","MM","MM"};

        for(String s : arr){
            s = "GG";
            System.out.println(s);
        }

        for(int i = 0;i < arr.length;i++){
            System.out.println(arr[i]);
        }


    }
}
